<template>
	<view class="">
		<view class="nav-back">	
			<top-heigth :backTitle="backTitle"></top-heigth>
		</view>
		<view v-if="list.length == 0" class="kong-box">
			<uv-empty mode="" text="目前没有拉黑的用户~" icon="/static/image/kong-lahei.png"></uv-empty>
		</view>
		<view class="content-box m-t24">
			<view class="public-box2" style="padding-top: 0; padding-bottom: 0;">
				<view class="complaint-top" v-for="item in list" @click="jie(item.id,item.version)">
					<view class="complaint-top-img">
						<view class="img"><image :src="item.tAppUserVo.userCover" mode=""></image></view>
						<view v-if="item.tAppUserVo">{{item.tAppUserVo.userName }}</view>
					</view>
					<view>{{item.createTime}}</view>
					<view class="complaint-top-img">
						<view class="img2"><image src="/static/image/jc.png" mode=""></image></view>
						<view class="img2-font">解除拉黑</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import TopHeigth from '@/components/TopHeigth.vue'
	
	export default {
		data() {
			return {
				backTitle:"拉黑列表",
				userInfo: uni.getStorageSync('userInfo'),
				list:[],
			}
		},
		components: { TopHeigth },
		onLoad() {
			this.getList()
		},
		methods: {
			getList(type) {
				uni.$u.http.post('/api/shop/v1_0/tAppUserBlackRCA/queryTAppUserBlack',{
						staffId: this.userInfo.id,
				}).then((res) => {
					this.list = res.aaData
				}) 
			},
			jie(id,version) {
				uni.showModal({
					title: '提示',
					content: '是否解除拉黑?',
					success: (res) => {
						if (res.confirm) {
							uni.$u.http.post('/api/shop/v1_0/tAppUserBlackRCA/deleteTAppUserBlack',{
									id:id,
									version:version,
							}).then((res) => {
								this.getList()
							}) 
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});
				
			},
		}
	}
</script>

<style lang="scss" scoped>
	@mixin flex($direction: row) {
		/* #ifndef APP-NVUE */
		display: flex;
		/* #endif */
		flex-direction: $direction;
	}
	.uv-nav-slot {
		@include flex;
		align-items: center;
		justify-content: space-between;
		border-width: 0.5px;
		border-radius: 100px;
		border-color: #dadbde;
		padding: 3px 7px;
		opacity: 0.8;
	}
	
	.complaint-top{
		@include flex;
		align-items: center;
		justify-content:space-between;
		font-size: 26rpx;
		padding: 20rpx 0;
		border-bottom: 2rpx solid #EEEEEE;
		.complaint-top-img{
			@include flex;
			align-items: center;
			justify-content:flex-start;
			font-size: 26rpx;
			.img{
				border-radius: 40rpx;
				overflow: hidden;
				font-weight: bold;
				color: #333;
				margin-right: 16rpx;
				image{
					width: 76rpx;
					height: 76rpx;
				}
			}
			.img2{
				overflow: hidden;
				font-weight: bold;
				color:#27A0FF;
				margin-right: 16rpx;
				image{
					width: 32rpx;
					height: 32rpx;
				}
			}
			.img2-font{
				color:#27A0FF;
			}
		}
		
	}
	.public-box2{
		.complaint-top:last-child{
			border-bottom:none;
		}
	}
</style>
